<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .color_list {
            display: flex;
        }
        
        .color_list li {
            width: 100px;
            height: 100px;
            list-style: none;
            text-align: center;
            line-height: 100px;
        }
        
        .box {
            width: 600px;
            height: 150px;
            background-color: #cccccc;
            line-height: 150px;
            text-align: center;
        }
    </style>
</head>

<body>
    <ul class="color_list">
        <li>red</li>
        <li>orange</li>
        <li>yellow</li>
        <li>green</li>
        <li>blue</li>
        <li>purple</li>
    </ul>
    <div class="box"></div>
    <script>
        var color_list = document.querySelector('.color_list');
        var box = document.querySelector('.box');

        function colorchange(e) {
            if (e.target.nodeName.toLowerCase() === 'li') {
                box.innerHTML = '该颜色为：' + e.target.innerHTML;
            }
        }
        color_list.addEventListener('click', colorchange, false);
    </script>
</body>

</html>